package com.foreveross.webbase.book.entity;

import java.util.Date;

import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.foreveross.webbase.common.persistence.DataEntity;

/**
 * 
 * @author hasee
 *
 */
public class Book extends DataEntity<Book> {

	private String id; // 书的Id
	private String bookname; // 书名
	private Date createtime; // 出版日期
	private String press;	//出版社
	private String bookpicture; // 封面
	private Integer bookpage; // 页数
	private String author; // 作者
	private Integer money; // 价格
	private String ext;		// 扩展名
	private String path;		// 路径
	
	public String getExt() {
		return ext;
	}

	public void setExt(String ext) {
		this.ext = ext;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Length(min = 0, max = 20, message = "书名长度必须介于0和20之间")
	public String getBookname() {
		return bookname;
	}

	public void setBookname(String bookname) {
		this.bookname = bookname;
	}

	@JsonFormat(pattern = "yyyy-MM-dd")
	public Date getCreatetime() {
		return createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}

	public String getPress() {
		return press;
	}

	public void setPress(String press) {
		this.press = press;
	}
	
	@Length(min = 0, max = 64, message = "文件大小长度必须介于0和64之间")
	public String getBookpicture() {
		return bookpicture;
	}

	public void setBookpicture(String bookpicture) {
		this.bookpicture = bookpicture;
	}

	public Integer getbookpage() {
		return bookpage;
	}

	public void setbookpage(Integer bookpage) {
		this.bookpage = bookpage;
	}

	@Length(min=0, max=20, message="作者名长必须介于0和20之间")
	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public Integer getMoney() {
		return money;
	}

	public void setMoney(Integer money) {
		this.money = money;
	}

}
